package javaweb.selectcclass.test.entity;

import lombok.*;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import java.util.List;

@Setter
@Getter
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "stu_course")
public class Course {
    @Id
    private String Id;
    private String name;
    @ManyToMany(mappedBy = "courses")
    private List<User> users;

    @Override
    public String toString() {
        return "Course{" +
                "name='" + name + '\'' +
                ", Id='" + Id + '\'' +
                '}';
    }
}
